package com.heima.media.controller;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.heima.common.dto.ResponseResult;
import com.heima.media.dto.SensitiveDto;
import com.heima.media.entity.WmSensitive;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.heima.media.service.IWmSensitiveService;
import java.util.List;
import java.util.Map;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 敏感词信息表 前端控制器
 * </p>
 *
 * @author mcm
 * @since 2022-03-14
 */
@RestController
@RequestMapping("/api/v1/sensitive")
@Api(tags = "敏感词信息表接口")
public class WmSensitiveController{

    @Autowired
    private IWmSensitiveService wmSensitiveService;
    //查询敏感词列表
    @PostMapping("/list")
    public ResponseResult listByPage(@RequestBody SensitiveDto dto){
        return wmSensitiveService.listByPage(dto);
    }
    //新增敏感词
    @PostMapping
    public ResponseResult newSave(@RequestBody WmSensitive wmSensitive){
        return wmSensitiveService.newSave(wmSensitive);
    }
    //修改敏感词
    @PutMapping
    public ResponseResult updateSensitive(@RequestBody WmSensitive wmSensitive){
        return wmSensitiveService.updateSensitive(wmSensitive);
    }
    //删除敏感词
    @DeleteMapping("{id}")
    public ResponseResult delete(@PathVariable Integer id){
        return wmSensitiveService.delete(id);
    }



}
